const gulp = require("gulp");
const connect = require("gulp-connect");
gulp.task("html-dev",()=>{
    return gulp.src("./src/*.html").pipe(gulp.dest("./dev")).pipe(connect.reload())
})
gulp.task("scripts-dev",()=>{
    return gulp.src("./src/js/*.js").pipe(gulp.dest("./dev/js")).pipe(connect.reload())
})
gulp.task("stylesheet-dev",()=>{
    return gulp.src("./src/css/*.css").pipe(gulp.dest("./dev/css")).pipe(connect.reload())
})
gulp.task("picture-dev",()=>{
    return gulp.src("./src/img/**/*").pipe(gulp.dest("./dev/img"))
})
gulp.task("connect",()=>{
    connect.server({
        root : 'dev',
        livereload : true
    })
})


gulp.task("watch",()=>{
    gulp.watch("./src/*.html",["html-dev"]);
    gulp.watch("./src/js/*.js",["scripts-dev"]);
    gulp.watch("./src/css/*.css",["stylesheet-dev"]);
})

gulp.task("gulp-dev",["html-dev","scripts-dev","stylesheet-dev","picture-dev","connect","watch"])
require("./build")